using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Practices.ObjectBuilder;
using Microsoft.Practices.CompositeWeb;
using System.Transactions;
using GC2.Entities.Admin;
using GC2.ExceptionHandler.Services;
using GC2.DataAccess.DAAdmin;

namespace GC2.Bussines.BMAdmin
{
    public class BMRemitosDet
    {
        public BMRemitosDet(string coneccion)
        {
            this.Connection = coneccion;
        }

        private string connection = "";
        public string Connection
        {
            get { return connection; }
            set { connection = value; }
        }

        private RemitosDet oRemitosDet = new RemitosDet();
        private List<RemitosDet> listaRemitosDet = new List<RemitosDet>();
        private DARemitosDet daRemitosDet = new DARemitosDet();


        #region BMremitosDetInsert
        public void BMRemitosDetInsert(RemitosDet remitosDet)
        {
            try
            {
                daRemitosDet.DARemitosDetInsert(connection, remitosDet);
            }
            catch (Exception ex)
            {
                ExceptionBM exNew = new ExceptionBM();
                throw new System.Exception(exNew.exBM(ex.ToString()).ToString());
            }
        }
        #endregion

        #region BMRemitosDetGetAll
        public List<RemitosDet> BMRemitosDetGetAll(RemitosDet remitosDet)
        {
            try
            {
                listaRemitosDet = daRemitosDet.DARemitosDetGetAll(connection, remitosDet);
                return listaRemitosDet;
            }
            catch (Exception ex)
            {
                ExceptionBM exNew = new ExceptionBM();
                throw new System.Exception(exNew.exBM(ex.ToString()).ToString());
            }
        }
        #endregion

        #region BMRemitosDetGetAllByLote
        public List<RemitosDet> BMRemitosDetGetAllByLote(RemitosDet remitosDet)
        {
            try
            {
                listaRemitosDet = daRemitosDet.DARemitosDetGetAllByLote(connection, remitosDet);
                return listaRemitosDet;
            }
            catch (Exception ex)
            {
                ExceptionBM exNew = new ExceptionBM();
                throw new System.Exception(exNew.exBM(ex.ToString()).ToString());
            }
        }
        #endregion

        #region BMRemitosDetDelete
        public void BMRemitosDetDelete(RemitosDet remitosDet)
        {
            try
            {
                daRemitosDet.DARemitosDetDelete(connection, remitosDet);
            }
            catch (Exception ex)
            {
                ExceptionBM exNew = new ExceptionBM();
                throw new System.Exception(exNew.exBM(ex.ToString()).ToString());
            }
        }
        #endregion
    }
}
